package com.app.common.dataDictionary.PO;

import java.util.*;
import com.css.sword.kernel.base.annotation.*;
import com.css.sword.kernel.base.dataElement.*;
import com.css.sword.kernel.base.exception.SwordBaseCheckedException;

import com.app.common.dataDictionary.DE.DE_USERID;
import com.app.common.dataDictionary.DE.DE_PHONEIMEI;
import com.app.common.dataDictionary.DE.DE_USEREMAIL;
import com.app.common.dataDictionary.DE.DE_USERPASSWORD;
import com.app.common.dataDictionary.DE.DE_PHONENUMBER;
import com.app.common.dataDictionary.DE.DE_PHONETYPE;
import com.app.common.dataDictionary.DE.DE_RECOMMENDCODE;
import com.app.common.dataDictionary.DE.DE_USERWEALTH;
import com.app.common.dataDictionary.DE.DE_REGTIME;
import com.app.common.dataDictionary.DE.DE_USERBRANDCLICKS;
import com.app.common.dataDictionary.DE.DE_OPPTIME;
import com.app.common.dataDictionary.DE.DE_DEVICESFCHANGED;
import com.app.common.dataDictionary.DE.DE_DEVICELASTCHANGETIME;


/**
 * 用户表
 */
@PersistObject
public class TUserPO extends AbsPersistObject {
	//private static final long serialVersionUID = -149843715727675118L;
	private static final long serialVersionUID = 1L;
	private static final Map<String, Integer> fieldIndex = new HashMap<String, Integer>(13);
	private static final BitSet HAS_DEFAULT_VALUE = new BitSet(13);
	
	static{
		HAS_DEFAULT_VALUE.set(7, true);HAS_DEFAULT_VALUE.set(9, true);HAS_DEFAULT_VALUE.set(11, true);
		fieldIndex.put("userid",0);fieldIndex.put("phoneimei",1);fieldIndex.put("useremail",2);fieldIndex.put("userpassword",3);fieldIndex.put("phonenumber",4);fieldIndex.put("phonetype",5);fieldIndex.put("recommendcode",6);fieldIndex.put("userwealth",7);fieldIndex.put("regtime",8);fieldIndex.put("userbrandclicks",9);fieldIndex.put("opptime",10);fieldIndex.put("devicesfchanged",11);fieldIndex.put("devicelastchangetime",12);
	}
	
	/**
	 * 物理表名
	 */
	public static final String TABLE_NAME = "t_user";

	/**
	 * 用户id
	 */
	private DE_USERID userid = DE_USERID.getTemplateInstance();

	/**
	 * 用户手机串号
	 */
	private DE_PHONEIMEI phoneimei = DE_PHONEIMEI.getTemplateInstance();

	/**
	 * 用户邮箱
	 */
	private DE_USEREMAIL useremail = DE_USEREMAIL.getTemplateInstance();

	/**
	 * 用户登录密码
	 */
	private DE_USERPASSWORD userpassword = DE_USERPASSWORD.getTemplateInstance();

	/**
	 * 用户手机号
	 */
	private DE_PHONENUMBER phonenumber = DE_PHONENUMBER.getTemplateInstance();

	/**
	 * 手机类型
	 */
	private DE_PHONETYPE phonetype = DE_PHONETYPE.getTemplateInstance();

	/**
	 * 应用推荐码
	 */
	private DE_RECOMMENDCODE recommendcode = DE_RECOMMENDCODE.getTemplateInstance();

	/**
	 * 用户财富值
	 */
	private DE_USERWEALTH userwealth = DE_USERWEALTH.getTemplateInstance();

	/**
	 * 注册时间
	 */
	private DE_REGTIME regtime = DE_REGTIME.getTemplateInstance();

	/**
	 * 用户对于所有品牌总共可点击次数
	 */
	private DE_USERBRANDCLICKS userbrandclicks = DE_USERBRANDCLICKS.getTemplateInstance();

	/**
	 * 操作时间
	 */
	private DE_OPPTIME opptime = DE_OPPTIME.getTemplateInstance();

	/**
	 * 设备是否更新过
	 */
	private DE_DEVICESFCHANGED devicesfchanged = DE_DEVICESFCHANGED.getTemplateInstance();

	/**
	 * 设备最后一次更新时间
	 */
	private DE_DEVICELASTCHANGETIME devicelastchangetime = DE_DEVICELASTCHANGETIME.getTemplateInstance();


	public TUserPO(){
		this.insertState = new BitSet(13);
		this.updateState = new BitSet(13);
	}

	
	/**
	 * 获取 "用户id" 值
	 */	
	public DE_USERID getUserid(){
		return  userid;
	}
	
	/**
	 * 设置 "用户id" 值
	 */
	public void setUserid(DE_USERID userid) {
		if(userid == null){
			userid= DE_USERID.getTemplateInstance();
		}
		recordChangeFlag(0);
		this.userid = userid;
	}
	
	/**
	 * 获取 "用户手机串号" 值
	 */	
	public DE_PHONEIMEI getPhoneimei(){
		return  phoneimei;
	}
	
	/**
	 * 设置 "用户手机串号" 值
	 */
	public void setPhoneimei(DE_PHONEIMEI phoneimei) {
		if(phoneimei == null){
			phoneimei= DE_PHONEIMEI.getTemplateInstance();
		}
		recordChangeFlag(1);
		this.phoneimei = phoneimei;
	}
	
	/**
	 * 获取 "用户邮箱" 值
	 */	
	public DE_USEREMAIL getUseremail(){
		return  useremail;
	}
	
	/**
	 * 设置 "用户邮箱" 值
	 */
	public void setUseremail(DE_USEREMAIL useremail) {
		if(useremail == null){
			useremail= DE_USEREMAIL.getTemplateInstance();
		}
		recordChangeFlag(2);
		this.useremail = useremail;
	}
	
	/**
	 * 获取 "用户登录密码" 值
	 */	
	public DE_USERPASSWORD getUserpassword(){
		return  userpassword;
	}
	
	/**
	 * 设置 "用户登录密码" 值
	 */
	public void setUserpassword(DE_USERPASSWORD userpassword) {
		if(userpassword == null){
			userpassword= DE_USERPASSWORD.getTemplateInstance();
		}
		recordChangeFlag(3);
		this.userpassword = userpassword;
	}
	
	/**
	 * 获取 "用户手机号" 值
	 */	
	public DE_PHONENUMBER getPhonenumber(){
		return  phonenumber;
	}
	
	/**
	 * 设置 "用户手机号" 值
	 */
	public void setPhonenumber(DE_PHONENUMBER phonenumber) {
		if(phonenumber == null){
			phonenumber= DE_PHONENUMBER.getTemplateInstance();
		}
		recordChangeFlag(4);
		this.phonenumber = phonenumber;
	}
	
	/**
	 * 获取 "手机类型" 值
	 */	
	public DE_PHONETYPE getPhonetype(){
		return  phonetype;
	}
	
	/**
	 * 设置 "手机类型" 值
	 */
	public void setPhonetype(DE_PHONETYPE phonetype) {
		if(phonetype == null){
			phonetype= DE_PHONETYPE.getTemplateInstance();
		}
		recordChangeFlag(5);
		this.phonetype = phonetype;
	}
	
	/**
	 * 获取 "应用推荐码" 值
	 */	
	public DE_RECOMMENDCODE getRecommendcode(){
		return  recommendcode;
	}
	
	/**
	 * 设置 "应用推荐码" 值
	 */
	public void setRecommendcode(DE_RECOMMENDCODE recommendcode) {
		if(recommendcode == null){
			recommendcode= DE_RECOMMENDCODE.getTemplateInstance();
		}
		recordChangeFlag(6);
		this.recommendcode = recommendcode;
	}
	
	/**
	 * 获取 "用户财富值" 值
	 */	
	public DE_USERWEALTH getUserwealth(){
		return  userwealth;
	}
	
	/**
	 * 设置 "用户财富值" 值
	 */
	public void setUserwealth(DE_USERWEALTH userwealth) {
		if(userwealth == null){
			userwealth= DE_USERWEALTH.getTemplateInstance();
		}
		recordChangeFlag(7);
		this.userwealth = userwealth;
	}
	
	/**
	 * 获取 "注册时间" 值
	 */	
	public DE_REGTIME getRegtime(){
		return  regtime;
	}
	
	/**
	 * 设置 "注册时间" 值
	 */
	public void setRegtime(DE_REGTIME regtime) {
		if(regtime == null){
			regtime= DE_REGTIME.getTemplateInstance();
		}
		recordChangeFlag(8);
		this.regtime = regtime;
	}
	
	/**
	 * 获取 "用户对于所有品牌总共可点击次数" 值
	 */	
	public DE_USERBRANDCLICKS getUserbrandclicks(){
		return  userbrandclicks;
	}
	
	/**
	 * 设置 "用户对于所有品牌总共可点击次数" 值
	 */
	public void setUserbrandclicks(DE_USERBRANDCLICKS userbrandclicks) {
		if(userbrandclicks == null){
			userbrandclicks= DE_USERBRANDCLICKS.getTemplateInstance();
		}
		recordChangeFlag(9);
		this.userbrandclicks = userbrandclicks;
	}
	
	/**
	 * 获取 "操作时间" 值
	 */	
	public DE_OPPTIME getOpptime(){
		return  opptime;
	}
	
	/**
	 * 设置 "操作时间" 值
	 */
	public void setOpptime(DE_OPPTIME opptime) {
		if(opptime == null){
			opptime= DE_OPPTIME.getTemplateInstance();
		}
		recordChangeFlag(10);
		this.opptime = opptime;
	}
	
	/**
	 * 获取 "设备是否更新过" 值
	 */	
	public DE_DEVICESFCHANGED getDevicesfchanged(){
		return  devicesfchanged;
	}
	
	/**
	 * 设置 "设备是否更新过" 值
	 */
	public void setDevicesfchanged(DE_DEVICESFCHANGED devicesfchanged) {
		if(devicesfchanged == null){
			devicesfchanged= DE_DEVICESFCHANGED.getTemplateInstance();
		}
		recordChangeFlag(11);
		this.devicesfchanged = devicesfchanged;
	}
	
	/**
	 * 获取 "设备最后一次更新时间" 值
	 */	
	public DE_DEVICELASTCHANGETIME getDevicelastchangetime(){
		return  devicelastchangetime;
	}
	
	/**
	 * 设置 "设备最后一次更新时间" 值
	 */
	public void setDevicelastchangetime(DE_DEVICELASTCHANGETIME devicelastchangetime) {
		if(devicelastchangetime == null){
			devicelastchangetime= DE_DEVICELASTCHANGETIME.getTemplateInstance();
		}
		recordChangeFlag(12);
		this.devicelastchangetime = devicelastchangetime;
	}


	@Override
	public BaseDataElement<?>[] fields(){
		return new BaseDataElement<?>[] {userid,phoneimei,useremail,userpassword,phonenumber,phonetype,recommendcode,userwealth,regtime,userbrandclicks,opptime,devicesfchanged,devicelastchangetime};
	}
	
	@Override
	public String[] fieldNames() {
		return new String[]{"userid","phoneimei","useremail","userpassword","phonenumber","phonetype","recommendcode","userwealth","regtime","userbrandclicks","opptime","devicesfchanged","devicelastchangetime"};
	}
	
	@Override
	public BaseDataElement<?> getFieldValue(String fieldName)  {
		final Integer index = fieldIndex.get(fieldName);
		if (index == null) {
			throw new IllegalArgumentException("PO对象中没有" + fieldName + "字段");
		}
		switch (index) {
		case 0 : return userid;
		case 1 : return phoneimei;
		case 2 : return useremail;
		case 3 : return userpassword;
		case 4 : return phonenumber;
		case 5 : return phonetype;
		case 6 : return recommendcode;
		case 7 : return userwealth;
		case 8 : return regtime;
		case 9 : return userbrandclicks;
		case 10 : return opptime;
		case 11 : return devicesfchanged;
		case 12 : return devicelastchangetime;
 
		default:
			throw new IllegalArgumentException("PO对象中没有" + fieldName + "字段");
		}
	}
	
	@Override
	public TUserPO setFieldValue(String fieldName, Object fieldValue) throws SwordBaseCheckedException {
		if (fieldValue != null && !(fieldValue instanceof BaseDataElement<?>)) {
			throw new SwordBaseCheckedException("字段值类型不是DataElelement子类型");
		}

		final Integer index = fieldIndex.get(fieldName);
		if (index == null) {
			throw new SwordBaseCheckedException("PO对象中没有" + fieldName + "字段");
		}

		switch (index) {

				case 0 : {
					if (fieldValue == null) {
						setUserid(null);
					} else {
						setUserid((DE_USERID) fieldValue);
					}
					return this;
				}
				
				case 1 : {
					if (fieldValue == null) {
						setPhoneimei(null);
					} else {
						setPhoneimei((DE_PHONEIMEI) fieldValue);
					}
					return this;
				}
				
				case 2 : {
					if (fieldValue == null) {
						setUseremail(null);
					} else {
						setUseremail((DE_USEREMAIL) fieldValue);
					}
					return this;
				}
				
				case 3 : {
					if (fieldValue == null) {
						setUserpassword(null);
					} else {
						setUserpassword((DE_USERPASSWORD) fieldValue);
					}
					return this;
				}
				
				case 4 : {
					if (fieldValue == null) {
						setPhonenumber(null);
					} else {
						setPhonenumber((DE_PHONENUMBER) fieldValue);
					}
					return this;
				}
				
				case 5 : {
					if (fieldValue == null) {
						setPhonetype(null);
					} else {
						setPhonetype((DE_PHONETYPE) fieldValue);
					}
					return this;
				}
				
				case 6 : {
					if (fieldValue == null) {
						setRecommendcode(null);
					} else {
						setRecommendcode((DE_RECOMMENDCODE) fieldValue);
					}
					return this;
				}
				
				case 7 : {
					if (fieldValue == null) {
						setUserwealth(null);
					} else {
						setUserwealth((DE_USERWEALTH) fieldValue);
					}
					return this;
				}
				
				case 8 : {
					if (fieldValue == null) {
						setRegtime(null);
					} else {
						setRegtime((DE_REGTIME) fieldValue);
					}
					return this;
				}
				
				case 9 : {
					if (fieldValue == null) {
						setUserbrandclicks(null);
					} else {
						setUserbrandclicks((DE_USERBRANDCLICKS) fieldValue);
					}
					return this;
				}
				
				case 10 : {
					if (fieldValue == null) {
						setOpptime(null);
					} else {
						setOpptime((DE_OPPTIME) fieldValue);
					}
					return this;
				}
				
				case 11 : {
					if (fieldValue == null) {
						setDevicesfchanged(null);
					} else {
						setDevicesfchanged((DE_DEVICESFCHANGED) fieldValue);
					}
					return this;
				}
				
				case 12 : {
					if (fieldValue == null) {
						setDevicelastchangetime(null);
					} else {
						setDevicelastchangetime((DE_DEVICELASTCHANGETIME) fieldValue);
					}
					return this;
				}
				
		default:
			throw new SwordBaseCheckedException("PO对象中没有" + fieldName + "字段");
		}
	
	}

	@Override
	protected TUserPO clone() {
		TUserPO t = new TUserPO();
		
		t.setUserid(this.userid);
		t.setPhoneimei(this.phoneimei);
		t.setUseremail(this.useremail);
		t.setUserpassword(this.userpassword);
		t.setPhonenumber(this.phonenumber);
		t.setPhonetype(this.phonetype);
		t.setRecommendcode(this.recommendcode);
		t.setUserwealth(this.userwealth);
		t.setRegtime(this.regtime);
		t.setUserbrandclicks(this.userbrandclicks);
		t.setOpptime(this.opptime);
		t.setDevicesfchanged(this.devicesfchanged);
		t.setDevicelastchangetime(this.devicelastchangetime);

		return t;
	}

	@Override
	public TUserPO loadMap(Map<String, Object> dataMap) throws SwordBaseCheckedException {
		Object value = null;

		if(dataMap.containsKey("userid")){
			value = dataMap.get("userid");
			
			if (value == null) {
				this.setUserid(null);
			} else {
				if (value instanceof DE_USERID) {
					this.setUserid((DE_USERID) value);
				}
			    else {
					this.setUserid(new DE_USERID(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("phoneimei")){
			value = dataMap.get("phoneimei");
			
			if (value == null) {
				this.setPhoneimei(null);
			} else {
				if (value instanceof DE_PHONEIMEI) {
					this.setPhoneimei((DE_PHONEIMEI) value);
				}
			    else {
					this.setPhoneimei(new DE_PHONEIMEI(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("useremail")){
			value = dataMap.get("useremail");
			
			if (value == null) {
				this.setUseremail(null);
			} else {
				if (value instanceof DE_USEREMAIL) {
					this.setUseremail((DE_USEREMAIL) value);
				}
			    else {
					this.setUseremail(new DE_USEREMAIL(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userpassword")){
			value = dataMap.get("userpassword");
			
			if (value == null) {
				this.setUserpassword(null);
			} else {
				if (value instanceof DE_USERPASSWORD) {
					this.setUserpassword((DE_USERPASSWORD) value);
				}
			    else {
					this.setUserpassword(new DE_USERPASSWORD(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("phonenumber")){
			value = dataMap.get("phonenumber");
			
			if (value == null) {
				this.setPhonenumber(null);
			} else {
				if (value instanceof DE_PHONENUMBER) {
					this.setPhonenumber((DE_PHONENUMBER) value);
				}
			    else {
					this.setPhonenumber(new DE_PHONENUMBER(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("phonetype")){
			value = dataMap.get("phonetype");
			
			if (value == null) {
				this.setPhonetype(null);
			} else {
				if (value instanceof DE_PHONETYPE) {
					this.setPhonetype((DE_PHONETYPE) value);
				}
			    else {
					this.setPhonetype(new DE_PHONETYPE(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("recommendcode")){
			value = dataMap.get("recommendcode");
			
			if (value == null) {
				this.setRecommendcode(null);
			} else {
				if (value instanceof DE_RECOMMENDCODE) {
					this.setRecommendcode((DE_RECOMMENDCODE) value);
				}
			    else {
					this.setRecommendcode(new DE_RECOMMENDCODE(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userwealth")){
			value = dataMap.get("userwealth");
			
			if (value == null) {
				this.setUserwealth(null);
			} else {
				if (value instanceof DE_USERWEALTH) {
					this.setUserwealth((DE_USERWEALTH) value);
				}
			    else {
					this.setUserwealth(new DE_USERWEALTH(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("regtime")){
			value = dataMap.get("regtime");
			
			if (value == null) {
				this.setRegtime(null);
			} else {
				if (value instanceof DE_REGTIME) {
					this.setRegtime((DE_REGTIME) value);
				}
				else if(value instanceof java.util.Date){
					this.setRegtime(new DE_REGTIME((java.util.Date)value));
				}
			    else {
					this.setRegtime(new DE_REGTIME(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userbrandclicks")){
			value = dataMap.get("userbrandclicks");
			
			if (value == null) {
				this.setUserbrandclicks(null);
			} else {
				if (value instanceof DE_USERBRANDCLICKS) {
					this.setUserbrandclicks((DE_USERBRANDCLICKS) value);
				}
			    else {
					this.setUserbrandclicks(new DE_USERBRANDCLICKS(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("opptime")){
			value = dataMap.get("opptime");
			
			if (value == null) {
				this.setOpptime(null);
			} else {
				if (value instanceof DE_OPPTIME) {
					this.setOpptime((DE_OPPTIME) value);
				}
				else if(value instanceof java.util.Date){
					this.setOpptime(new DE_OPPTIME((java.util.Date)value));
				}
			    else {
					this.setOpptime(new DE_OPPTIME(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("devicesfchanged")){
			value = dataMap.get("devicesfchanged");
			
			if (value == null) {
				this.setDevicesfchanged(null);
			} else {
				if (value instanceof DE_DEVICESFCHANGED) {
					this.setDevicesfchanged((DE_DEVICESFCHANGED) value);
				}
			    else {
					this.setDevicesfchanged(new DE_DEVICESFCHANGED(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("devicelastchangetime")){
			value = dataMap.get("devicelastchangetime");
			
			if (value == null) {
				this.setDevicelastchangetime(null);
			} else {
				if (value instanceof DE_DEVICELASTCHANGETIME) {
					this.setDevicelastchangetime((DE_DEVICELASTCHANGETIME) value);
				}
				else if(value instanceof java.util.Date){
					this.setDevicelastchangetime(new DE_DEVICELASTCHANGETIME((java.util.Date)value));
				}
			    else {
					this.setDevicelastchangetime(new DE_DEVICELASTCHANGETIME(value.toString()));
				}
			}
		}

		return this;
	}
	
	@Override
	public Map<String,Object> toMap() {
		Map<String,Object> dataMap = new HashMap<String,Object>();

		dataMap.put("userid", userid);
		dataMap.put("phoneimei", phoneimei);
		dataMap.put("useremail", useremail);
		dataMap.put("userpassword", userpassword);
		dataMap.put("phonenumber", phonenumber);
		dataMap.put("phonetype", phonetype);
		dataMap.put("recommendcode", recommendcode);
		dataMap.put("userwealth", userwealth);
		dataMap.put("regtime", regtime);
		dataMap.put("userbrandclicks", userbrandclicks);
		dataMap.put("opptime", opptime);
		dataMap.put("devicesfchanged", devicesfchanged);
		dataMap.put("devicelastchangetime", devicelastchangetime);
		
		return dataMap;
	}
	
	@Override
	public Map<String,Object> toMapWithDEValue() {
		Map<String,Object> dataMap = new HashMap<String,Object>();

		dataMap.put("userid", (userid==null?null:userid.value));
		dataMap.put("phoneimei", (phoneimei==null?null:phoneimei.value));
		dataMap.put("useremail", (useremail==null?null:useremail.value));
		dataMap.put("userpassword", (userpassword==null?null:userpassword.value));
		dataMap.put("phonenumber", (phonenumber==null?null:phonenumber.value));
		dataMap.put("phonetype", (phonetype==null?null:phonetype.value));
		dataMap.put("recommendcode", (recommendcode==null?null:recommendcode.value));
		dataMap.put("userwealth", (userwealth==null?null:userwealth.value));
		dataMap.put("regtime", (regtime==null?null:regtime.value));
		dataMap.put("userbrandclicks", (userbrandclicks==null?null:userbrandclicks.value));
		dataMap.put("opptime", (opptime==null?null:opptime.value));
		dataMap.put("devicesfchanged", (devicesfchanged==null?null:devicesfchanged.value));
		dataMap.put("devicelastchangetime", (devicelastchangetime==null?null:devicelastchangetime.value));
		
		return dataMap;
	}
	
	@Override
	public TUserPO newInstance() {
		return new TUserPO();
	}
	
	@Override
	public String getTableName(){
		return TABLE_NAME;
	}
	
	@Override
	public BaseDataElement<?>[] getPrimaryKey() {
		return new BaseDataElement<?>[]{userid};
	}

	@Override
	public void checkNotNull(byte sqlType) throws SwordBaseCheckedException {
		StringBuilder errorMsg = new StringBuilder();
		// insert
		if (sqlType == 0) {
				//只校验不可为空但又没有默认值的字段
				if (userid.value == null && !HAS_DEFAULT_VALUE.get(0)) {
					errorMsg.append("字段userid不允许为空\n");
				}
				if (phoneimei.value == null && !HAS_DEFAULT_VALUE.get(1)) {
					errorMsg.append("字段phoneimei不允许为空\n");
				}
				if (useremail.value == null && !HAS_DEFAULT_VALUE.get(2)) {
					errorMsg.append("字段useremail不允许为空\n");
				}
				if (userpassword.value == null && !HAS_DEFAULT_VALUE.get(3)) {
					errorMsg.append("字段userpassword不允许为空\n");
				}
				if (phonenumber.value == null && !HAS_DEFAULT_VALUE.get(4)) {
					errorMsg.append("字段phonenumber不允许为空\n");
				}
				if (phonetype.value == null && !HAS_DEFAULT_VALUE.get(5)) {
					errorMsg.append("字段phonetype不允许为空\n");
				}
				if (recommendcode.value == null && !HAS_DEFAULT_VALUE.get(6)) {
					errorMsg.append("字段recommendcode不允许为空\n");
				}
				if (userwealth.value == null && !HAS_DEFAULT_VALUE.get(7)) {
					errorMsg.append("字段userwealth不允许为空\n");
				}
				if (regtime.value == null && !HAS_DEFAULT_VALUE.get(8)) {
					errorMsg.append("字段regtime不允许为空\n");
				}
				if (userbrandclicks.value == null && !HAS_DEFAULT_VALUE.get(9)) {
					errorMsg.append("字段userbrandclicks不允许为空\n");
				}
				if (opptime.value == null && !HAS_DEFAULT_VALUE.get(10)) {
					errorMsg.append("字段opptime不允许为空\n");
				}
				if (devicesfchanged.value == null && !HAS_DEFAULT_VALUE.get(11)) {
					errorMsg.append("字段devicesfchanged不允许为空\n");
				}
				if (devicelastchangetime.value == null && !HAS_DEFAULT_VALUE.get(12)) {
					errorMsg.append("字段devicelastchangetime不允许为空\n");
				}

		}
		// update
		else if (sqlType == 1) {
		if (updateState.get(0) && userid.value == null) {
			errorMsg.append("字段userid不允许为空\n");
		}
		if (updateState.get(1) && phoneimei.value == null) {
			errorMsg.append("字段phoneimei不允许为空\n");
		}
		if (updateState.get(2) && useremail.value == null) {
			errorMsg.append("字段useremail不允许为空\n");
		}
		if (updateState.get(3) && userpassword.value == null) {
			errorMsg.append("字段userpassword不允许为空\n");
		}
		if (updateState.get(4) && phonenumber.value == null) {
			errorMsg.append("字段phonenumber不允许为空\n");
		}
		if (updateState.get(5) && phonetype.value == null) {
			errorMsg.append("字段phonetype不允许为空\n");
		}
		if (updateState.get(6) && recommendcode.value == null) {
			errorMsg.append("字段recommendcode不允许为空\n");
		}
		if (updateState.get(7) && userwealth.value == null) {
			errorMsg.append("字段userwealth不允许为空\n");
		}
		if (updateState.get(8) && regtime.value == null) {
			errorMsg.append("字段regtime不允许为空\n");
		}
		if (updateState.get(9) && userbrandclicks.value == null) {
			errorMsg.append("字段userbrandclicks不允许为空\n");
		}
		if (updateState.get(10) && opptime.value == null) {
			errorMsg.append("字段opptime不允许为空\n");
		}
		if (updateState.get(11) && devicesfchanged.value == null) {
			errorMsg.append("字段devicesfchanged不允许为空\n");
		}
		if (updateState.get(12) && devicelastchangetime.value == null) {
			errorMsg.append("字段devicelastchangetime不允许为空\n");
		}

		}
		
		if (errorMsg.length() > 0) {
			errorMsg.setLength(errorMsg.length() - 1);
			throw new SwordBaseCheckedException(errorMsg.toString());
		}
	}

	@Override
	public void updateLrrq(DateDE lrrq) {
	}

	@Override
	public void updateXgrq(DateDE xgrq) {
	}

	@Override
	public String toString() {
		StringBuilder str = new StringBuilder();
		str.append("userid:").append(userid.value!=null?userid:"").append(" ").append("phoneimei:").append(phoneimei.value!=null?phoneimei:"").append(" ").append("useremail:").append(useremail.value!=null?useremail:"").append(" ").append("userpassword:").append(userpassword.value!=null?userpassword:"").append(" ").append("phonenumber:").append(phonenumber.value!=null?phonenumber:"").append(" ").append("phonetype:").append(phonetype.value!=null?phonetype:"").append(" ").append("recommendcode:").append(recommendcode.value!=null?recommendcode:"").append(" ").append("userwealth:").append(userwealth.value!=null?userwealth:"").append(" ").append("regtime:").append(regtime.value!=null?regtime:"").append(" ").append("userbrandclicks:").append(userbrandclicks.value!=null?userbrandclicks:"").append(" ").append("opptime:").append(opptime.value!=null?opptime:"").append(" ").append("devicesfchanged:").append(devicesfchanged.value!=null?devicesfchanged:"").append(" ").append("devicelastchangetime:").append(devicelastchangetime.value!=null?devicelastchangetime:"").append(" ");
		return str.toString();
	}
	
}
